/**
 * 
 */
package com.trendytech.tds.system.dao;

import java.util.List;

import com.trendytech.tds.entity.User;

import hm.base.dao.IBaseDAO;

/**
 * @author Robin
 *
 */
public interface IUserDAO extends IBaseDAO<User> {

	/**
	 * Select user by username
	 * @param username
	 * @return
	 */
	public User getByUsername(String username);
	
	/**
	 * Insert the relationship of user and role
	 * @param userId
	 * @param roleId
	 * @return
	 */
	public int insertUserRole(String userId, String roleId);
	
	/**
	 * delete the relationship of user and role
	 * @param userId
	 * @param roleId
	 * @return
	 */
	public int deleteUserRole(String userId, String roleId);
	
	/**
	 * Select user by RoleID
	 * @param roleId
	 * @return
	 */
	public List<User> selectByRoleId(String roleId);

	/**
	 * delete the relationship of user in user_role
	 * @param userId
	 * @return
	 */
	public int deleteUsersInRole(String userId);
	
	public String getNameById(String userId);
	
}
